import {upload} from '@/services/document';
import {Effect} from "dva";

export interface DocumentStateType {

}

export interface DocumentModelType {
  namespace: 'document';
  state: DocumentStateType;
  effects: {
    upload:Effect;
  };
  reducers: {};
}
const DocumentModel: DocumentModelType = {
  namespace: 'document',
  state:{},
  effects:{
    *upload({ payload }, { call }) {
      const {data} = yield call(upload, payload);
      return data;
    },
  },
  reducers: {}
};
export default DocumentModel;
